import { LayerConfig, addLayer, LayerType, removeLayer } from "../layer/layerManage.ts";
import { getLayerManagerState } from "../layer/layerManagerState.ts";
// 添加图片
export function addImage(map: any, id: string, url: string, coordinates: any) {
    // map.addSource(id, )
    const layer: LayerConfig = {
        'id': id,
        'type': LayerType.Raster,
        'source': {
            'type': 'image',
            'url': url,
            'coordinates': coordinates
        }
    }
    addLayer(getLayerManagerState(map), layer)
}

// 移除图片
export function removeImage(map: any, id: string) {
    removeLayer(getLayerManagerState(map), id)
}
